feat(pairing): handle v2 pairing timeouts and cancellations - #21078
Open
vbudhram wants to merge 1 commit into
Open
feat(pairing): handle v2 pairing timeouts and cancellations#21078vbudhram wants to merge 1 commit into
vbudhram wants to merge 1 commit into
Conversation
vbudhram
force-pushed
the
fxa-13870
branch
4 times, most recently
from
August 20, 2026 22:38
1282979 to
ce30465
Compare
vbudhram
force-pushed
the
fxa-13870
branch
4 times, most recently
from
August 21, 2026 17:52
f185b1c to
5a5a897
Compare
vbudhram
marked this pull request as ready for review
August 24, 2026 20:58
Contributor
There was a problem hiding this comment.
Pull request overview
Adds cause-specific timeout/cancellation screens to the v2 pairing flow and prevents QR screens from waiting indefinitely.
Changes:
- Propagates and renders timeout versus cancellation reasons.
- Adds a two-minute authority QR timeout.
- Adds container and channel teardown tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Supplicant/TimeoutAndCancel/container.tsx |
Selects the interruption variant from the URL. |
Supplicant/TimeoutAndCancel/container.test.tsx |
Tests reason parsing and fallbacks. |
Supplicant/ConnectThisDevice/container.tsx |
Adds interruption reasons to exit routes. |
Supplicant/ApproveSignIn/container.tsx |
Distinguishes cancellation from channel failure. |
Authority/TimeoutAndCancel/container.tsx |
Selects the variant and wires actions. |
Authority/TimeoutAndCancel/container.test.tsx |
Tests variants and actions. |
Authority/ScanQR/container.tsx |
Adds the no-scan timeout. |
Authority/ScanQR/container.test.tsx |
Updates failure navigation coverage. |
Authority/ContinueOnMobile/container.tsx |
Marks user cancellation explicitly. |
pairing-flow.test.ts |
Tests channel and handshake cleanup. |
App/index.tsx |
Routes the supplicant screen through its container. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+68
to
+71
| inactivityTimer = setTimeout( | ||
| () => navigate('/pair/authority/timeout_and_cancel?reason=timeout'), | ||
| SCAN_QR_TIMEOUT_MS | ||
| ); |
Comment on lines
+40
to
+42
| navigateWithQuery( | ||
| '/pair/supplicant/timeout_and_cancel?reason=canceled' | ||
| ); |
Comment on lines
+68
to
+71
| inactivityTimer = setTimeout( | ||
| () => navigate('/pair/authority/timeout_and_cancel?reason=timeout'), | ||
| SCAN_QR_TIMEOUT_MS | ||
| ); |
Because: - FXA-13869 needs the v2 pairing flow to end cleanly on a timeout or a cancel, close the channel, and tell the user why. This commit: - adds a supplicant timeout_and_cancel container and passes the reason to the authority container, so both dead-end screens show timeout or canceled. - sends reason=canceled from cancel buttons and reason=timeout from channel disconnects and the no-scan inactivity timeout. - adds Jest tests for both containers and for the channel teardown on reset.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
This pull request
?reason=timeout/?reason=canceledparam on both timeout screens, defaulting totimeoutwhen absent, so each side renders the right variant.Authority/ScanQR/container.tsx, cleared once a device scans or the flow fails.Authority/ContinueOnMobile,Supplicant/ApproveSignIn, andSupplicant/ConnectThisDevice.Supplicant/TimeoutAndCancel/container.tsxand routesApp/index.tsxat it instead of the bare page.pairing-flow.test.ts.Issue that this pull request solves
Closes: https://mozilla-hub.atlassian.net/browse/FXA-13869
Checklist
Other information
nx test-unit fxa-settings(Pair/Pair2/integrations/channels): 490 passed, 0 failed.How to test: start the stack, open
/pair/authority/scan_qrin a signed-in Firefox, and leave it untouched for two minutes — it should land ontimeout_and_cancelwith the timeout copy. Cancelling fromcontinue_on_mobileinstead should show the canceled copy.Note: rebased onto the current
fxa-13870after that branch was force-pushed. The authority side moved from thepairingFlowmodule toPairingAuthorityIntegration, sowireAborthere is expressed as theAuthorityState.Failedbranch, and the two authority container tests were updated to the integration API.